/**
 * 
 */
package edu.avans.hartigehap.domain.decorator;

import javax.persistence.*;

/**
 * @author Chris
 *
 */
@Entity
@DiscriminatorValue("MenuItemWithIngredient")
public class MenuItemWithIngredient extends MenuItemDecorator
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private TestIngredient testIngredient;
	//private AbstractMenuItem abstractMenuItem;
	private int price;
	
	public MenuItemWithIngredient() {
	}
	
	public MenuItemWithIngredient(AbstractMenuItem ami) {
		super(ami);
	}

	@Transient
	public int getPrice() {
		if(super.abstractMenuItem != null)
		{
			return super.getPrice() + getTestIngredient().getPrice();
		}
		else
		{
			return price;
		}
	}

	public void setPrice(int price) {
		this.price = price;
	}

	@Transient
	public TestIngredient getTestIngredient() {
		return testIngredient;
	}

	public void setTestIngredient(TestIngredient testIngredient) {
		this.testIngredient = testIngredient;
	}	
}
